package com.boot.code;

import com.boot.code.properties.CodeProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.thymeleaf.spring5.SpringTemplateEngine;

@SpringBootApplication
public class CodeApplication {

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(CodeApplication.class, args);
        CodeProperties properties = context.getBean(CodeProperties.class);
        SpringTemplateEngine engine = context.getBean(SpringTemplateEngine.class);
        CodeBuilder builder = new CodeBuilder(engine);
        builder.build(properties);
    }

}
